package com.hna.eking.AirlineServer.Platform.FileUpload;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.DispatcherServlet;

//@Configuration
//@EnableConfigurationProperties(MultipartProperties.class)
public class MultipartConfiguration{
	
//	private final MultipartProperties multipartProperties;
//
//	public MultipartAutoConfiguration(MultipartProperties multipartProperties) {
//		this.multipartProperties = multipartProperties;
//	}
//	
//	@Bean
//	@ConditionalOnMissingBean
//	public MultipartConfigElement multipartConfigElement() {
//		return this.multipartProperties.createMultipartConfig();
//	}
	
//	@Bean(name = DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME)
//	public CommonsMultipartResolver multipartResolver() {
//		System.out.println("multipartResolver()");
//		CommonsMultipartResolver multipartResolver = new CommonsMultipartResolverExt();
//		multipartResolver.setMaxUploadSizePerFile(100000); //单文件大小，单位byte
//		return multipartResolver;
//	}
	
//	@Bean(name = DispatcherServlet.MULTIPART_RESOLVER_BEAN_NAME)
//	public CommonsMultipartResolver multipartResolver() {
//		CommonsMultipartResolver resolver = new CommonsMultipartResolver();
//		resolver.setMaxUploadSizePerFile(100000); //单文件大小，单位byte
//		resolver.setResolveLazily(true);
//		return resolver;
//	}
}
